/* 
 * DataStructures.h
 *
 * Created: 09/03/2014 07:39:15
 * Author: Jason
 * Data definitions and structures for both processors.
 *
 */ 


#ifndef DATASTRUCTURES_H_
#define DATASTRUCTURES_H_

#ifdef __cplusplus  
  extern "C" {
#endif

#define ROBOT_FUNCTION_WAITFORUSER 0
#define ROBOT_FUNCTION_LINEFOLLOWER 1
#define ROBOT_FUNCTION_WALLFOLLOWER 2

unsigned char robotFunction;
  
typedef struct lineSensorData_type
{
  unsigned char dataFresh;
  unsigned char sensor1;
  unsigned char sensor2;
  unsigned char sensor3;
  unsigned char sensor4;
  unsigned char sensor5;
} lineSensorData_type;

typedef struct linePositionData_type
{
  unsigned char dataFresh;
  signed char linePosition;
  unsigned char LeftMarker;
  unsigned char RightMarker;
} linePositionData_type;


typedef struct wallSensorData_type
{
  unsigned char dataFresh;
  unsigned char sensor1;
  unsigned char sensor2;
  unsigned char sensor3;
  unsigned char sensor4;
  unsigned char sensor5;
  unsigned char sensor6;
} wallSensorData_type;

typedef struct HCIData_type
{
  unsigned char dataFresh;
  unsigned char ButtonsState;
  unsigned char LEDState;
} HCIData_type;  

#define HCIButton1 1
#define HCIButton2 2
#define HCIButton3 4
#define HCILED1 1
#define HCILED2 2
#define HCILED3 4
 
typedef struct MotorData_type
{
  unsigned char dataFresh;
  signed char LeftSpeed;
  signed char RightSpeed;
} MotorData_type;



#ifdef __cplusplus
  }
#endif

#endif /* DATASTRUCTURES_H_ */